#version 310 es
#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#endif

precision highp float;
precision highp int;
#define HLSLCC_ENABLE_UNIFORM_BUFFERS 1
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
#define UNITY_UNIFORM
#else
#define UNITY_UNIFORM uniform
#endif
#define UNITY_SUPPORTS_UNIFORM_LOCATION 1
#if UNITY_SUPPORTS_UNIFORM_LOCATION
#define UNITY_LOCATION(x) layout(location = x)
#define UNITY_BINDING(x) layout(binding = x, std140)
#else
#define UNITY_LOCATION(x)
#define UNITY_BINDING(x) layout(std140)
#endif
uniform 	vec4 _ScaledScreenParams;
uniform 	vec2 _GlobalMipBias;
uniform 	vec4 _MainLightPosition;
uniform 	mediump vec4 _MainLightColor;
uniform 	vec4 _FPParams0;
uniform 	vec4 _FPParams1;
uniform 	vec4 _AdditionalLightsPosition[16];
uniform 	mediump vec4 _AdditionalLightsColor[16];
uniform 	mediump vec4 _AdditionalLightsAttenuation[16];
uniform 	mediump vec4 _AdditionalLightsSpotDir[16];
uniform 	vec3 _WorldSpaceCameraPos;
uniform 	vec4 unity_OrthoParams;
uniform 	vec4 hlslcc_mtx4x4unity_MatrixV[4];
uniform 	vec4 _MainLightShadowParams;
UNITY_BINDING(0) uniform URP_ZBinBuffer {
	vec4                URP_ZBins[1024];
};
UNITY_BINDING(1) uniform urp_TileBuffer {
	vec4                urp_Tiles[1024];
};
UNITY_BINDING(2) uniform UnityPerDraw {
	vec4 Xhlslcc_UnusedXhlslcc_mtx4x4unity_ObjectToWorld[4];
	vec4 Xhlslcc_UnusedXhlslcc_mtx4x4unity_WorldToObject[4];
	vec4 Xhlslcc_UnusedXunity_LODFade;
	mediump vec4 Xhlslcc_UnusedXunity_WorldTransformParams;
	vec4 Xhlslcc_UnusedXunity_RenderingLayer;
	mediump vec4 Xhlslcc_UnusedXunity_LightData;
	mediump vec4 Xhlslcc_UnusedXunity_LightIndices[2];
	vec4 Xhlslcc_UnusedXunity_ProbesOcclusion;
	mediump vec4 Xhlslcc_UnusedXunity_SpecCube0_HDR;
	mediump vec4 Xhlslcc_UnusedXunity_SpecCube1_HDR;
	vec4 Xhlslcc_UnusedXunity_SpecCube0_BoxMax;
	vec4 Xhlslcc_UnusedXunity_SpecCube0_BoxMin;
	vec4 Xhlslcc_UnusedXunity_SpecCube0_ProbePosition;
	vec4 Xhlslcc_UnusedXunity_SpecCube1_BoxMax;
	vec4 Xhlslcc_UnusedXunity_SpecCube1_BoxMin;
	vec4 Xhlslcc_UnusedXunity_SpecCube1_ProbePosition;
	vec4 Xhlslcc_UnusedXunity_LightmapST;
	vec4 Xhlslcc_UnusedXunity_DynamicLightmapST;
	mediump vec4                unity_SHAr;
	mediump vec4                unity_SHAg;
	mediump vec4                unity_SHAb;
	mediump vec4                unity_SHBr;
	mediump vec4                unity_SHBg;
	mediump vec4                unity_SHBb;
	mediump vec4                unity_SHC;
	vec4 Xhlslcc_UnusedXunity_RendererBounds_Min;
	vec4 Xhlslcc_UnusedXunity_RendererBounds_Max;
	vec4 Xhlslcc_UnusedXhlslcc_mtx4x4unity_MatrixPreviousM[4];
	vec4 Xhlslcc_UnusedXhlslcc_mtx4x4unity_MatrixPreviousMI[4];
	vec4 Xhlslcc_UnusedXunity_MotionVectorsParams;
};
UNITY_BINDING(3) uniform UnityPerMaterial {
	vec4 Xhlslcc_UnusedX_SoftParticleFadeParams;
	vec4 Xhlslcc_UnusedX_CameraFadeParams;
	vec4 Xhlslcc_UnusedX_BaseMap_ST;
	mediump vec4                _BaseColor;
	mediump vec4 Xhlslcc_UnusedX_EmissionColor;
	mediump vec4 Xhlslcc_UnusedX_BaseColorAddSubDiff;
	mediump vec4 Xhlslcc_UnusedX_SpecColor;
	mediump float Xhlslcc_UnusedX_Cutoff;
	mediump float Xhlslcc_UnusedX_Smoothness;
	mediump float Xhlslcc_UnusedX_DistortionStrengthScaled;
	mediump float Xhlslcc_UnusedX_DistortionBlend;
	mediump float                _Surface;
};
UNITY_LOCATION(0) uniform mediump sampler2D _MainLightShadowmapTexture;
UNITY_LOCATION(1) uniform mediump sampler2DShadow hlslcc_zcmp_MainLightShadowmapTexture;
UNITY_LOCATION(2) uniform mediump sampler2D _BaseMap;
layout(location = 0) in highp vec2 vs_TEXCOORD0;
layout(location = 1) in mediump vec4 vs_COLOR0;
layout(location = 2) in highp vec4 vs_TEXCOORD1;
layout(location = 3) in mediump vec3 vs_TEXCOORD2;
layout(location = 4) in highp vec4 vs_TEXCOORD7;
layout(location = 0) out mediump vec4 SV_Target0;
mediump vec4 u_xlat16_0;
vec4 u_xlat1;
bool u_xlatb1;
mediump vec3 u_xlat16_2;
mediump vec4 u_xlat16_3;
mediump vec3 u_xlat16_4;
vec3 u_xlat5;
ivec4 u_xlati5;
uint u_xlatu5;
bool u_xlatb5;
vec3 u_xlat6;
ivec2 u_xlati6;
uvec2 u_xlatu6;
vec3 u_xlat7;
ivec2 u_xlati7;
mediump vec3 u_xlat16_8;
mediump vec3 u_xlat16_9;
ivec2 u_xlati15;
uint u_xlatu15;
bool u_xlatb15;
vec3 u_xlat16;
ivec2 u_xlati16;
bool u_xlatb16;
float u_xlat17;
float u_xlat25;
ivec2 u_xlati25;
uint u_xlatu25;
ivec2 u_xlati26;
uint u_xlatu26;
float u_xlat31;
mediump float u_xlat16_31;
uint u_xlatu31;
bool u_xlatb31;
mediump float u_xlat16_32;
float u_xlat35;
int u_xlati35;
uint u_xlatu35;
float u_xlat36;
int int_bitfieldExtract(int value, int offset, int bits) {
#if defined(GL_ES) && __VERSION__ <= 300
    return (bits == 0) ? 0 : (offset + bits < 32) ? ((value << (32 - bits - offset)) >> (32 - bits)) : (value >> offset);
#else
    return bitfieldExtract(value, offset, (offset + bits < 32) ? bits : (32 - offset));
#endif
}

void main()
{
vec4 hlslcc_FragCoord = vec4(gl_FragCoord.xyz, 1.0/gl_FragCoord.w);
    u_xlat16_0 = texture(_BaseMap, vs_TEXCOORD0.xy, _GlobalMipBias.x);
    u_xlat16_0 = u_xlat16_0 * _BaseColor;
    u_xlat16_0 = u_xlat16_0 * vs_COLOR0;
    u_xlat1.x = dot(vs_TEXCOORD2.xyz, vs_TEXCOORD2.xyz);
    u_xlat1.x = inversesqrt(u_xlat1.x);
    u_xlat1.xyz = u_xlat1.xxx * vs_TEXCOORD2.xyz;
    u_xlat1.w = 1.0;
    u_xlat16_2.x = dot(unity_SHAr, u_xlat1);
    u_xlat16_2.y = dot(unity_SHAg, u_xlat1);
    u_xlat16_2.z = dot(unity_SHAb, u_xlat1);
    u_xlat16_3 = u_xlat1.yzzx * u_xlat1.xyzz;
    u_xlat16_4.x = dot(unity_SHBr, u_xlat16_3);
    u_xlat16_4.y = dot(unity_SHBg, u_xlat16_3);
    u_xlat16_4.z = dot(unity_SHBb, u_xlat16_3);
    u_xlat16_32 = u_xlat1.y * u_xlat1.y;
    u_xlat16_32 = u_xlat1.x * u_xlat1.x + (-u_xlat16_32);
    u_xlat16_3.xyz = unity_SHC.xyz * vec3(u_xlat16_32) + u_xlat16_4.xyz;
    u_xlat16_2.xyz = u_xlat16_2.xyz + u_xlat16_3.xyz;
    u_xlat16_2.xyz = max(u_xlat16_2.xyz, vec3(0.0, 0.0, 0.0));
    vec3 txVec0 = vec3(vs_TEXCOORD7.xy,vs_TEXCOORD7.z);
    u_xlat16_31 = textureLod(hlslcc_zcmp_MainLightShadowmapTexture, txVec0, 0.0);
    u_xlat16_32 = (-_MainLightShadowParams.x) + 1.0;
    u_xlat16_32 = u_xlat16_31 * _MainLightShadowParams.x + u_xlat16_32;
    u_xlatb31 = 0.0>=vs_TEXCOORD7.z;
    u_xlatb5 = vs_TEXCOORD7.z>=1.0;
    u_xlatb31 = u_xlatb31 || u_xlatb5;
    u_xlat16_32 = (u_xlatb31) ? 1.0 : u_xlat16_32;
    u_xlat5.xyz = vs_TEXCOORD1.xyz + (-_WorldSpaceCameraPos.xyz);
    u_xlat31 = dot(u_xlat5.xyz, u_xlat5.xyz);
    u_xlat31 = u_xlat31 * _MainLightShadowParams.z + _MainLightShadowParams.w;
    u_xlat31 = clamp(u_xlat31, 0.0, 1.0);
    u_xlat16_3.x = (-u_xlat16_32) + 1.0;
    u_xlat16_32 = u_xlat31 * u_xlat16_3.x + u_xlat16_32;
    u_xlat6.xyz = vec3(u_xlat16_32) * _MainLightColor.xyz;
    u_xlat16_32 = dot(u_xlat1.xyz, _MainLightPosition.xyz);
    u_xlat16_32 = clamp(u_xlat16_32, 0.0, 1.0);
    u_xlat16_3.xyz = vec3(u_xlat16_32) * u_xlat6.xyz;
    u_xlat16_3.xyz = u_xlat16_0.xyz * u_xlat16_3.xyz;
    u_xlatu31 = uint(_FPParams0.w);
    u_xlatu35 = min(u_xlatu31, 16u);
    u_xlat16_4.x = float(0.0);
    u_xlat16_4.y = float(0.0);
    u_xlat16_4.z = float(0.0);
    for(uint u_xlatu_loop_1 = 0u ; u_xlatu_loop_1<u_xlatu35 ; u_xlatu_loop_1++)
    {
        u_xlat16.xyz = (-vs_TEXCOORD1.xyz) * _AdditionalLightsPosition[int(u_xlatu_loop_1)].www + _AdditionalLightsPosition[int(u_xlatu_loop_1)].xyz;
        u_xlat7.x = dot(u_xlat16.xyz, u_xlat16.xyz);
        u_xlat7.x = max(u_xlat7.x, 6.10351562e-05);
        u_xlat17 = inversesqrt(u_xlat7.x);
        u_xlat16.xyz = u_xlat16.xyz * vec3(u_xlat17);
        u_xlat17 = float(1.0) / float(u_xlat7.x);
        u_xlat7.x = u_xlat7.x * _AdditionalLightsAttenuation[int(u_xlatu_loop_1)].x;
        u_xlat16_32 = (-u_xlat7.x) * u_xlat7.x + 1.0;
        u_xlat16_32 = max(u_xlat16_32, 0.0);
        u_xlat16_32 = u_xlat16_32 * u_xlat16_32;
        u_xlat7.x = u_xlat16_32 * u_xlat17;
        u_xlat16_32 = dot(_AdditionalLightsSpotDir[int(u_xlatu_loop_1)].xyz, u_xlat16.xyz);
        u_xlat16_32 = u_xlat16_32 * _AdditionalLightsAttenuation[int(u_xlatu_loop_1)].z + _AdditionalLightsAttenuation[int(u_xlatu_loop_1)].w;
        u_xlat16_32 = clamp(u_xlat16_32, 0.0, 1.0);
        u_xlat16_32 = u_xlat16_32 * u_xlat16_32;
        u_xlat7.x = u_xlat16_32 * u_xlat7.x;
        u_xlat7.xyz = u_xlat7.xxx * _AdditionalLightsColor[int(u_xlatu_loop_1)].xyz;
        u_xlat16_32 = dot(u_xlat1.xyz, u_xlat16.xyz);
        u_xlat16_32 = clamp(u_xlat16_32, 0.0, 1.0);
        u_xlat16_8.xyz = vec3(u_xlat16_32) * u_xlat7.xyz;
        u_xlat16_4.xyz = u_xlat16_8.xyz * u_xlat16_0.xyz + u_xlat16_4.xyz;
    }
    u_xlatu35 = uint(_FPParams1.w);
    if(u_xlatu35 != uint(0)) {
        u_xlat6.xy = vec2(1.0) / vec2(_ScaledScreenParams.xy);
        u_xlat6.xy = u_xlat6.xy * hlslcc_FragCoord.xy;
        u_xlat6.xy = u_xlat6.xy * _FPParams1.xy;
        u_xlatu6.xy = uvec2(u_xlat6.xy);
        u_xlatu26 = uint(_FPParams1.z);
        u_xlati6.x = int(u_xlatu6.y) * int(u_xlatu26) + int(u_xlatu6.x);
        u_xlatu6.x = u_xlatu35 * uint(u_xlati6.x);
        u_xlat7.x = (-hlslcc_mtx4x4unity_MatrixV[0].z);
        u_xlat7.y = (-hlslcc_mtx4x4unity_MatrixV[1].z);
        u_xlat7.z = (-hlslcc_mtx4x4unity_MatrixV[2].z);
        u_xlat5.x = dot(u_xlat7.xyz, u_xlat5.xyz);
        u_xlatb15 = unity_OrthoParams.w==0.0;
        u_xlat25 = log2(u_xlat5.x);
        u_xlat5.x = (u_xlatb15) ? u_xlat25 : u_xlat5.x;
        u_xlat5.x = u_xlat5.x * _FPParams0.x + _FPParams0.y;
        u_xlatu5 = uint(u_xlat5.x);
        u_xlatu5 = min(u_xlatu5, 4095u);
        u_xlati15.x = int(u_xlatu35) + 2;
        u_xlatu25 = uint(u_xlati15.x) * u_xlatu5;
        u_xlatu5 = u_xlatu5 * uint(u_xlati15.x) + 2u;
        u_xlatu15 = u_xlatu25 >> (2u & uint(0x1F));
        u_xlati25.xy = ivec2(int_bitfieldExtract(int(u_xlatu25), int(0) & int(0x1F), int(1) & int(0x1F)), int_bitfieldExtract(int(u_xlatu25), int(1) & int(0x1F), int(1) & int(0x1F)));
        u_xlati16.xy = ivec2(uvec2(u_xlati25.xx) & uvec2(floatBitsToUint(URP_ZBins[int(u_xlatu15)].wy)));
        u_xlati7.xy = ~(u_xlati25.xy);
        u_xlati15.xy = ivec2(uvec2(u_xlati7.xx) & uvec2(floatBitsToUint(URP_ZBins[int(u_xlatu15)].zx)));
        u_xlati15.xy = ivec2(uvec2(u_xlati15.xy) | uvec2(u_xlati16.xy));
        u_xlati15.x = int(uint(u_xlati25.y) & uint(u_xlati15.x));
        u_xlati25.x = int(uint(u_xlati7.y) & uint(u_xlati15.y));
        u_xlatu15 = uint(u_xlati25.x) | uint(u_xlati15.x);
        u_xlatu25 = u_xlatu6.x >> (2u & uint(0x1F));
        u_xlati6.xy = ivec2(int_bitfieldExtract(int(u_xlatu6.x), int(0) & int(0x1F), int(1) & int(0x1F)), int_bitfieldExtract(int(u_xlatu6.x), int(1) & int(0x1F), int(1) & int(0x1F)));
        u_xlati26.xy = ivec2(uvec2(u_xlati6.xx) & uvec2(floatBitsToUint(urp_Tiles[int(u_xlatu25)].wy)));
        u_xlati7.xy = ~(u_xlati6.xy);
        u_xlati25.xy = ivec2(uvec2(u_xlati7.xx) & uvec2(floatBitsToUint(urp_Tiles[int(u_xlatu25)].zx)));
        u_xlati25.xy = ivec2(uvec2(u_xlati25.xy) | uvec2(u_xlati26.xy));
        u_xlati25.x = int(uint(u_xlati6.y) & uint(u_xlati25.x));
        u_xlati35 = int(uint(u_xlati7.y) & uint(u_xlati25.y));
        u_xlati25.x = int(uint(u_xlati35) | uint(u_xlati25.x));
        u_xlatu35 = u_xlatu5 >> (2u & uint(0x1F));
        u_xlati6.xy = ivec2(int_bitfieldExtract(int(u_xlatu5), int(0) & int(0x1F), int(1) & int(0x1F)), int_bitfieldExtract(int(u_xlatu5), int(1) & int(0x1F), int(1) & int(0x1F)));
        u_xlati26.xy = ivec2(uvec2(u_xlati6.xx) & uvec2(floatBitsToUint(URP_ZBins[int(u_xlatu35)].wy)));
        u_xlati7.xy = ~(u_xlati6.xy);
        u_xlati5.xw = ivec2(uvec2(u_xlati7.xx) & uvec2(floatBitsToUint(URP_ZBins[int(u_xlatu35)].zx)));
        u_xlati5.xw = ivec2(uvec2(u_xlati5.xw) | uvec2(u_xlati26.xy));
        u_xlati5.x = int(uint(u_xlati6.y) & uint(u_xlati5.x));
        u_xlati35 = int(uint(u_xlati7.y) & uint(u_xlati5.w));
        u_xlati5.x = int(uint(u_xlati35) | uint(u_xlati5.x));
        u_xlati5.x = int(uint(u_xlati5.x) & uint(u_xlati25.x));
        u_xlati25.x = int(0xFFFFFFFFu) << (int(u_xlatu15) & int(0x1F));
        u_xlati5.x = int(uint(u_xlati25.x) & uint(u_xlati5.x));
        u_xlatu15 = u_xlatu15 >> (16u & uint(0x1F));
        u_xlatu15 = (-u_xlatu15) + 31u;
        u_xlatu15 = 4294967295u >> (u_xlatu15 & uint(0x1F));
        u_xlati5.x = int(u_xlatu15 & uint(u_xlati5.x));
    } else {
        u_xlati5.x = 0;
    }
    u_xlat16_8.xyz = u_xlat16_4.xyz;
    u_xlati15.x = u_xlati5.x;
    while(true){
        if(u_xlati15.x == 0) {break;}
        u_xlati25.x = findLSB(uint(u_xlati15.x));
        u_xlati35 = 1 << (u_xlati25.x & int(0x1F));
        u_xlati15.x = int(uint(u_xlati35) ^ uint(u_xlati15.x));
        u_xlati25.x = int(u_xlatu31) + u_xlati25.x;
        u_xlat6.xyz = (-vs_TEXCOORD1.xyz) * _AdditionalLightsPosition[u_xlati25.x].www + _AdditionalLightsPosition[u_xlati25.x].xyz;
        u_xlat35 = dot(u_xlat6.xyz, u_xlat6.xyz);
        u_xlat35 = max(u_xlat35, 6.10351562e-05);
        u_xlat36 = inversesqrt(u_xlat35);
        u_xlat6.xyz = vec3(u_xlat36) * u_xlat6.xyz;
        u_xlat36 = float(1.0) / float(u_xlat35);
        u_xlat35 = u_xlat35 * _AdditionalLightsAttenuation[u_xlati25.x].x;
        u_xlat16_32 = (-u_xlat35) * u_xlat35 + 1.0;
        u_xlat16_32 = max(u_xlat16_32, 0.0);
        u_xlat16_32 = u_xlat16_32 * u_xlat16_32;
        u_xlat35 = u_xlat16_32 * u_xlat36;
        u_xlat16_32 = dot(_AdditionalLightsSpotDir[u_xlati25.x].xyz, u_xlat6.xyz);
        u_xlat16_32 = u_xlat16_32 * _AdditionalLightsAttenuation[u_xlati25.x].z + _AdditionalLightsAttenuation[u_xlati25.x].w;
        u_xlat16_32 = clamp(u_xlat16_32, 0.0, 1.0);
        u_xlat16_32 = u_xlat16_32 * u_xlat16_32;
        u_xlat35 = u_xlat16_32 * u_xlat35;
        u_xlat7.xyz = vec3(u_xlat35) * _AdditionalLightsColor[u_xlati25.x].xyz;
        u_xlat16_32 = dot(u_xlat1.xyz, u_xlat6.xyz);
        u_xlat16_32 = clamp(u_xlat16_32, 0.0, 1.0);
        u_xlat16_9.xyz = vec3(u_xlat16_32) * u_xlat7.xyz;
        u_xlat16_8.xyz = u_xlat16_9.xyz * u_xlat16_0.xyz + u_xlat16_8.xyz;
    }
    u_xlat16_2.xyz = u_xlat16_2.xyz * u_xlat16_0.xyz + u_xlat16_3.xyz;
    SV_Target0.xyz = u_xlat16_8.xyz + u_xlat16_2.xyz;
    u_xlatb1 = _Surface==1.0;
    SV_Target0.w = (u_xlatb1) ? u_xlat16_0.w : 1.0;
    return;
}


// Keywords: PROCEDURAL_INSTANCING_ON _FORWARD_PLUS _MAIN_LIGHT_SHADOWS
// 